*** Prep analysis in stata:
cd
	
import delimited "intermediary_outputs/base_with_connection_data_stata.csv", clear

label var negro_na "Nonwhite"

destring negro_na skin_color race race_simple grades_score scores_poverty ///
male religion_simple age_grade_distortion score_self_esteem ///
score_parents_support score_study  score_neighborhood_quality ///
occ_*  sh_nw_class_special , replace force

destring sh_nw_class_special_std avg_score_racism_class class_size ///
	avg_score_climate_school_class avg_score_homophobia_class ///
	avg_anti_equality_score_class  high_school avg_dominance_score_class ///
	avg_scores_poverty_class avg_score_violence_school_class /// 
	avg_score_parents_support_class avg_score_self_esteem_class /// 
	avg_score_study_class edfis_missing sh_missing_interview_class ///
	avg_score_neighborhood_quality_c age , replace force

global ses scores_poverty i.occ_mother_simple_no_job_no_na ///
i.occ_father_simple_no_job_no_na score_neighborhood_quality

global ind_vars male age_grade_distortion score_self_esteem ///
score_parents_support score_study 

global class_char sh_nw_class_special_std avg_score_racism_class class_size ///
	avg_score_climate_school_class avg_score_homophobia_class ///
	avg_anti_equality_score_class high_school avg_dominance_score_class ///
	avg_scores_poverty_class avg_score_violence_school_class /// 
	avg_score_parents_support_class avg_score_self_esteem_class /// 
	avg_score_study_class edfis_missing sh_missing_interview_class ///
	avg_score_neighborhood_quality_c 
		
		
label var grades_score "Grades"	
label def race_simple 1 "White" 2 "Black" 3 "Brown" 4 "Other"
label values race_simple race_simple 

cap gen ind_sh_nw_class = sh_nw_class >= .5263158
cap gen ind_grades = grades_score >= -0.07911165

gen white_na = (negro_na == 0) if negro_na != .
label var white_na "White"
gen serie_new = grade + 5 if grade <= 10
	
cd

do 12_mlogit_analysis.do
	
do 13_mlogit_analysis_het.do	
		
